<!doctype html>
<html>

	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="apple-mobile-web-app-status-bar-style" content="black">
		<title>查询团队服务通知</title>
		<!-- css代码 start -->
		<link href="../../../css/mui.min.css" rel="stylesheet" />
		<link href="../../../css/global.css" rel="stylesheet" />
		<link href="../../../css/style.css" rel="stylesheet" />
		<link rel="stylesheet" href="../../../css/mui.picker.css">
		<link rel="stylesheet" href="../../../css/mui.poppicker.css">
		<link rel="stylesheet" href="../../../css/task.css">
		<style>
			.d_int_tp{
				border: 0 !important;
				margin-top: 6px !important;
			}
			.details_con .btm .selectBtn {
			    line-height: 28px;
			    color: #ffffff;
			    background: #ea1e1a;
			}
			
			.item_box .item .text{
				margin: 5px auto;
			}
			.item_box .item .text span.cen{
				margin-left:0;
			}
			.item_box .item .text span{
				width: auto;
			}
			
			.select-tzstate{
				width: 100%;
				border: 0;
				color: #a9a9a9;
				font-size: 16px;
				text-align: left;
				padding: 15px;
			}
			.mui-bar-nav{
				box-shadow: 0 1px 6px #ea1e1a;
			}
			.vip{
				background: #ea1e1a;
				color: #fff !important;
				border-radius: 30px;
				width: 70px;
				font-size: 14px !important;
				height: 30px;
				line-height: 30px;
				text-align: center;
			}
		</style>
		<!-- css代码 end -->
	</head>

	<body>
		<!-- html代码 start -->
		<header class="mui-bar mui-bar-nav">
			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
			<h1 id="title" class="mui-title">查询团队服务通知</h1>
		</header>
		<div class="mui-content">
			
			<div class="details_con select_con" id="search">
				<div class="clum">
					<input type="text" class="d_int_tp" id="customerName" placeholder="输入客户名称" />
				</div>
				<div class="clum">
					<!-- <input type="text" class="d_int_tp" id="serviceType" placeholder="输入服务类型" /> -->
					<span class="txt" style="width: 100%;">
						<input type="hidden" id="serviceTypeValue" />
						<button id='serviceType' class="mui-btn mui-btn-block mui-btn-select select-tzstate" type='button'>请选择服务子类型</button>
					</span>
				</div>
				<div class="clum">
					<input type="text" class="d_int_tp" id="enginnerName" placeholder="输入工程师姓名" />
				</div>
				<div class="btm autoHeight">
					<p class="selectBtn" id="searchBtn" onclick="initData()">查 询</p>
				</div>
			</div>
			
			<div class="details_con" style="margin: 30px 0 0 0;">
				<div class="item_box" id="itemBox">
					
<!-- 					<div class="item"><div class="bar"><span class="number" onclick="findFse('1219488','679','336')">1219488<img src="../../../images/icon_204.png" /></span><span class="vip" onclick="assignFse(679,1219488)">指派FSE</span></div><div class="text">虚拟<span>客户名称：</span></div><div class="type"><p><div class="lpl">提交时间：</div><span>2020-04-26 10:26:06</span><img src="../../../images/icon_202.png"/></p><p><div class="lpl">服务子类型：</div><span>维修</span><img src="../../../images/icon_203.png"/></p><p><div class="lpl">期望服务时间：</div><span>无</span><img src="../../../images/icon_202.png"/></p><p><div class="lpl">客户类型：</div><span>普通用户</span><img src="../../../images/icon_203.png"/></p></div></div><div class="item"><div class="bar"><span class="number" onclick="findFse('1219489','680','337')">1219489<img src="../../../images/icon_204.png" /></span><span class="vip" onclick="assignFse(680,1219489)">指派FSE</span></div><div class="text">虚拟<span>客户名称：</span></div><div class="type"><p><div class="lpl">提交时间：</div><span>2020-04-26 13:49:15</span><img src="../../../images/icon_202.png"/></p><p><div class="lpl">服务子类型：</div><span>销售支持</span><img src="../../../images/icon_203.png"/></p><p><div class="lpl">期望服务时间：</div><span>无</span><img src="../../../images/icon_202.png"/></p><p><div class="lpl">客户类型：</div><span>普通用户</span><img src="../../../images/icon_203.png"/></p></div></div><div class="item"><div class="bar"><span class="number" onclick="findFse('1219490','681','338')">1219490<img src="../../../images/icon_204.png" /></span><span class="vip" onclick="assignFse(681,1219490)">指派FSE</span></div><div class="text">虚拟<span>客户名称：</span></div><div class="type"><p><div class="lpl">提交时间：</div><span>2020-04-26 14:54:49</span><img src="../../../images/icon_202.png"/></p><p><div class="lpl">服务子类型：</div><span>安装准备</span><img src="../../../images/icon_203.png"/></p><p><div class="lpl">期望服务时间：</div><span>无</span><img src="../../../images/icon_202.png"/></p><p><div class="lpl">客户类型：</div><span>普通用户</span><img src="../../../images/icon_203.png"/></p></div></div><div class="item"><div class="bar"><span class="number" onclick="findFse('1219491','682','339')">1219491<img src="../../../images/icon_204.png" /></span><span class="vip" onclick="assignFse(682,1219491)">指派FSE</span></div><div class="text">虚拟<span>客户名称：</span></div><div class="type"><p><div class="lpl">提交时间：</div><span>2020-04-26 14:56:21</span><img src="../../../images/icon_202.png"/></p><p><div class="lpl">服务子类型：</div><span>升级</span><img src="../../../images/icon_203.png"/></p><p><div class="lpl">期望服务时间：</div><span>无</span><img src="../../../images/icon_202.png"/></p><p><div class="lpl">客户类型：</div><span>普通用户</span><img src="../../../images/icon_203.png"/></p></div></div><div class="item"><div class="bar"><span class="number" onclick="findFse('1219493','683','340')">1219493<img src="../../../images/icon_204.png" /></span><span class="vip" onclick="assignFse(683,1219493)">指派FSE</span></div><div class="text">虚拟<span>客户名称：</span></div><div class="type"><p><div class="lpl">提交时间：</div><span>2020-04-26 15:14:59</span><img src="../../../images/icon_202.png"/></p><p><div class="lpl">服务子类型：</div><span>销售支持-顺访</span><img src="../../../images/icon_203.png"/></p><p><div class="lpl">期望服务时间：</div><span>无</span><img src="../../../images/icon_202.png"/></p><p><div class="lpl">客户类型：</div><span>普通用户</span><img src="../../../images/icon_203.png"/></p></div></div><div class="item"><div class="bar"><span class="number" onclick="findFse('1219494','684','341')">1219494<img src="../../../images/icon_204.png" /></span><span class="vip" onclick="assignFse(684,1219494)">指派FSE</span></div><div class="text">虚拟<span>客户名称：</span></div><div class="type"><p><div class="lpl">提交时间：</div><span>2020-04-26 16:17:35</span><img src="../../../images/icon_202.png"/></p><p><div class="lpl">服务子类型：</div><span>维修</span><img src="../../../images/icon_203.png"/></p><p><div class="lpl">期望服务时间：</div><span>无</span><img src="../../../images/icon_202.png"/></p><p><div class="lpl">客户类型：</div><span>普通用户</span><img src="../../../images/icon_203.png"/></p></div></div><div class="item"><div class="bar"><span class="number" onclick="findFse('1219495','685','342')">1219495<img src="../../../images/icon_204.png" /></span><span class="vip" onclick="assignFse(685,1219495)">指派FSE</span></div><div class="text">虚拟<span>客户名称：</span></div><div class="type"><p><div class="lpl">提交时间：</div><span>2020-04-26 16:19:35</span><img src="../../../images/icon_202.png"/></p><p><div class="lpl">服务子类型：</div><span>销售支持</span><img src="../../../images/icon_203.png"/></p><p><div class="lpl">期望服务时间：</div><span>无</span><img src="../../../images/icon_202.png"/></p><p><div class="lpl">客户类型：</div><span>普通用户</span><img src="../../../images/icon_203.png"/></p></div></div><div class="item"><div class="bar"><span class="number" onclick="findFse('1219497','687','343')">1219497<img src="../../../images/icon_204.png" /></span><span class="vip" onclick="assignFse(687,1219497)">指派FSE</span></div><div class="text">虚拟<span>客户名称：</span></div><div class="type"><p><div class="lpl">提交时间：</div><span>2020-04-26 16:41:53</span><img src="../../../images/icon_202.png"/></p><p><div class="lpl">服务子类型：</div><span>维修</span><img src="../../../images/icon_203.png"/></p><p><div class="lpl">期望服务时间：</div><span>无</span><img src="../../../images/icon_202.png"/></p><p><div class="lpl">客户类型：</div><span>普通用户</span><img src="../../../images/icon_203.png"/></p></div></div><div class="item"><div class="bar"><span class="number" onclick="findFse('1219498','688','344')">1219498<img src="../../../images/icon_204.png" /></span><span class="vip" onclick="assignFse(688,1219498)">指派FSE</span></div><div class="text">虚拟<span>客户名称：</span></div><div class="type"><p><div class="lpl">提交时间：</div><span>2020-04-26 17:06:18</span><img src="../../../images/icon_202.png"/></p><p><div class="lpl">服务子类型：</div><span>维修</span><img src="../../../images/icon_203.png"/></p><p><div class="lpl">期望服务时间：</div><span>无</span><img src="../../../images/icon_202.png"/></p><p><div class="lpl">客户类型：</div><span>普通用户</span><img src="../../../images/icon_203.png"/></p></div></div><div class="item"><div class="bar"><span class="number" onclick="findFse('1219499','689','345')">1219499<img src="../../../images/icon_204.png" /></span><span class="vip" onclick="assignFse(689,1219499)">指派FSE</span></div><div class="text">虚拟<span>客户名称：</span></div><div class="type"><p><div class="lpl">提交时间：</div><span>2020-04-26 17:17:41</span><img src="../../../images/icon_202.png"/></p><p><div class="lpl">服务子类型：</div><span>维修</span><img src="../../../images/icon_203.png"/></p><p><div class="lpl">期望服务时间：</div><span>无</span><img src="../../../images/icon_202.png"/></p><p><div class="lpl">客户类型：</div><span>普通用户</span><img src="../../../images/icon_203.png"/></p></div></div><div class="item"><div class="bar"><span class="number" onclick="findFse('1219500','690','346')">1219500<img src="../../../images/icon_204.png" /></span><span class="vip" onclick="assignFse(690,1219500)">指派FSE</span></div><div class="text">虚拟<span>客户名称：</span></div><div class="type"><p><div class="lpl">提交时间：</div><span>2020-04-26 17:38:14</span><img src="../../../images/icon_202.png"/></p><p><div class="lpl">服务子类型：</div><span>安装</span><img src="../../../images/icon_203.png"/></p><p><div class="lpl">期望服务时间：</div><span>无</span><img src="../../../images/icon_202.png"/></p><p><div class="lpl">客户类型：</div><span>普通用户</span><img src="../../../images/icon_203.png"/></p></div></div><div class="item"><div class="bar"><span class="number" onclick="findFse('1219501','691','347')">1219501<img src="../../../images/icon_204.png" /></span><span class="vip" onclick="assignFse(691,1219501)">指派FSE</span></div><div class="text">虚拟<span>客户名称：</span></div><div class="type"><p><div class="lpl">提交时间：</div><span>2020-04-27 10:39:15</span><img src="../../../images/icon_202.png"/></p><p><div class="lpl">服务子类型：</div><span>维修</span><img src="../../../images/icon_203.png"/></p><p><div class="lpl">期望服务时间：</div><span>无</span><img src="../../../images/icon_202.png"/></p><p><div class="lpl">客户类型：</div><span>普通用户</span><img src="../../../images/icon_203.png"/></p></div></div><div class="item"><div class="bar"><span class="number" onclick="findFse('1219490','681','348')">1219490<img src="../../../images/icon_204.png" /></span><span class="vip" onclick="assignFse(681,1219490)">指派FSE</span></div><div class="text">虚拟<span>客户名称：</span></div><div class="type"><p><div class="lpl">提交时间：</div><span>2020-04-26 14:54:49</span><img src="../../../images/icon_202.png"/></p><p><div class="lpl">服务子类型：</div><span>安装准备</span><img src="../../../images/icon_203.png"/></p><p><div class="lpl">期望服务时间：</div><span>无</span><img src="../../../images/icon_202.png"/></p><p><div class="lpl">客户类型：</div><span>普通用户</span><img src="../../../images/icon_203.png"/></p></div></div><div class="item"><div class="bar"><span class="number" onclick="findFse('1219491','682','349')">1219491<img src="../../../images/icon_204.png" /></span><span class="vip" onclick="assignFse(682,1219491)">指派FSE</span></div><div class="text">虚拟<span>客户名称：</span></div><div class="type"><p><div class="lpl">提交时间：</div><span>2020-04-26 14:56:21</span><img src="../../../images/icon_202.png"/></p><p><div class="lpl">服务子类型：</div><span>升级</span><img src="../../../images/icon_203.png"/></p><p><div class="lpl">期望服务时间：</div><span>无</span><img src="../../../images/icon_202.png"/></p><p><div class="lpl">客户类型：</div><span>普通用户</span><img src="../../../images/icon_203.png"/></p></div></div><div class="item"><div class="bar"><span class="number" onclick="findFse('1219497','687','350')">1219497<img src="../../../images/icon_204.png" /></span><span class="vip" onclick="assignFse(687,1219497)">指派FSE</span></div><div class="text">虚拟<span>客户名称：</span></div><div class="type"><p><div class="lpl">提交时间：</div><span>2020-04-26 16:41:53</span><img src="../../../images/icon_202.png"/></p><p><div class="lpl">服务子类型：</div><span>维修</span><img src="../../../images/icon_203.png"/></p><p><div class="lpl">期望服务时间：</div><span>无</span><img src="../../../images/icon_202.png"/></p><p><div class="lpl">客户类型：</div><span>普通用户</span><img src="../../../images/icon_203.png"/></p></div></div><div class="item"><div class="bar"><span class="number" onclick="findFse('1219385','732','无')">1219385<img src="../../../images/icon_204.png" /></span><span class="vip" onclick="assignFse(732,1219385)">指派FSE</span></div><div class="text">天华<span>客户名称：</span></div><div class="type"><p><div class="lpl">提交时间：</div><span>2018-11-07 10:20:38</span><img src="../../../images/icon_202.png"/></p><p><div class="lpl">服务子类型：</div><span>维修</span><img src="../../../images/icon_203.png"/></p><p><div class="lpl">期望服务时间：</div><span>2017-12-21 00:00:00</span><img src="../../../images/icon_202.png"/></p><p><div class="lpl">客户类型：</div><span>合同用户</span><img src="../../../images/icon_203.png"/></p></div></div>
 -->					
				</div>
			</div>
			<div style="height: 50px;"></div>
		</div>
		<!-- html代码 end -->
		
		<!-- js代码 start -->
		
		<!-- 基础js start -->
		<script src="../../../js/mui.min.js"></script>
		<script src="../../../js/utils/h.js"></script>
		<script src="../../../js/constant.js"></script>
		<script src="../../../js/common.js"></script>
		<script src="../../../js/utils/base64.js"></script>
		<script src="../../../js/utils/md5.js"></script>
		<script src="../../../js/utils/sortMap.js"></script>
		<script src="../../../js/utils/http.js"></script>
		<script src="../../../js/app.js"></script>
		<!-- 基础js end -->
		<script src="../../../js/mui.picker.js"></script>
		<script src="../../../js/mui.poppicker.js"></script>
		<script type="text/javascript" charset="utf-8">
			function initData(){
				app.showWaiting('加载中...')
				var customerName = h("#customerName").val();
				var serviceType = h("#serviceType").html();
				if(serviceType=='请选择服务子类型'){
					serviceType = ""
				}
				var enginnerName = h("#enginnerName").val();
				ajaxGet(BASE_URL + "cc/notice/getTeamServiceNoticesByTL", {
					"TeamleaderId": app.getUser().enginnerId,
					"customerName": customerName,
					"serviceType": serviceType,
					"enginnerName": enginnerName,
					"appState":"1,2"
				}, function(data) {
					app.closeWaiting()
					if (data.code === 200) {
						var str = '';
						if (data.data && data.data.length > 0) {
							for(var c = 0;c<data.data.length;c++){
								var customerName = data.data[c].customerName ? data.data[c].customerName : "";
								var createTime = data.data[c].createTime ? data.data[c].createTime : "";
								var serviceType = data.data[c].subServiceType ? data.data[c].subServiceType : "";
								var enginnerType = data.data[c].enginnerType ? data.data[c].enginnerType : "";
								 
								var serviceNo = data.data[c].serviceNo ? data.data[c].serviceNo : "";
								var id = data.data[c].id ? data.data[c].id : "";
								//var planId = data.data[c].planId ? data.data[c].planId : "";
								str += '<div class="item">';
								str += '<div class="bar">';
								str += '<span class="number" onclick="findFse(\''+serviceNo+'\',\''+id+'\')"><img src="../../../images/icon_204.png" />'+data.data[c].serviceNo+'</span>';
								str += '<span class="vip" onclick="assignFse('+data.data[c].id+','+data.data[c].serviceNo+')">指派FSE</span>';
								str += '</div>';
								str += '<div class="text" onclick="findFse(\''+serviceNo+'\',\''+id+'\')">';
								str += customerName;			
								str += '</div>';
								str += '<div class="type" onclick="findFse(\''+serviceNo+'\',\''+id+'\')">';
								str += '<p><img src="../../../images/icon_202.png"/><span class="lpl">提交时间：</span><span>'+createTime+'</span></p>'
								str += '<p><img src="../../../images/icon_203.png"/><span class="lpl">服务子类型：</span><span>'+serviceType+'</span></p>'
								var hopeBusinessHours = data.data[c].hopeBusinessHours ? data.data[c].hopeBusinessHours : "";
								str += '<p><img src="../../../images/icon_202.png"/><span class="lpl">期望服务时间：</span><span>'+hopeBusinessHours+'</span></p>';
								str += '<p><img src="../../../images/icon_203.png"/><span class="lpl">客户类型：</span><span>'+enginnerType+'</span></p>';
								str += '</div>';
								str += '</div>';
							}
							h('#itemBox').html(str);
						}else{
							var html = '<div class="nodata">—— 暂无数据 ——</div>';
							h("#itemBox").html(html);
						}
					} else {
						var html = '<div class="nodata">—— 暂无数据 ——</div>';
						h("#itemBox").html(html);
						app.toast(data.msg)
					}
				}, function(errorMsg) {
					app.closeWaiting()
					var html = '<div class="nodata">—— 暂无数据 ——</div>';
					h("#itemBox").html(html);
					app.toast("数据获取失败，请检查网络连接");
				});
			}
			
			(function($, doc) {
				$.init();
		
				$.plusReady(function() {
					var self = plus.webview.currentWebview();
					initData()	
					
					// 服务子类型下拉
					h('#serviceType').tap(function() {
						var userPicker = new $.PopPicker();
						ajaxGetJson(BASE_URL + 'cc/dict/selectCCDict', {
							tableName: 'snsubtype',
							engineerId: app.getUser().enginnerId
						}, function(data) {
							console.log(JSON.stringify(data))
							if (!data) {
								app.toast("无下拉内容")
								return
							}
							// 数组指定位置插入数据
							data.splice(0, 0, {"text":"请选择服务子类型","value":""});
							userPicker.setData(data);
							userPicker.show(function(items) {
								h('#serviceType').html(items[0].text)
								h('#serviceTypeValue').val(items[0].value)
								userPicker.dispose()
							});
						});
					});
					
					h('.mui-action-back').tap(function () {
						var noticeMenu=plus.webview.getWebviewById('view/service/notice/noticeMenu.html');
						if(noticeMenu){
							noticeMenu.evalJS('getNoticeCount()')
						}
					});
				});
			}(mui, document));
			function findFse(serviceNo,id){
				app.jumpTo("/view/service/notice/serviceEngineerList.html", "view/service/notice/serviceEngineerList.html",
				{
					serviceNo: serviceNo,
					serviceNoticeId: id
				});
			}
			
			function assignFse(serviceNoticeId, serviceNo){
				// app.toast(serviceNoticeId+","+serviceNo);
				app.jumpTo("/view/service/assign/assignFSE.html", "view/service/assign/assignFSE.html", {
					ServiceNoticeId: serviceNoticeId,
					serviceNo: serviceNo
				});
			}
			
		</script>
		<!-- js代码 end -->
	</body>

</html>
